<!DOCTYPE html>
<html>
<head>
<title>{$site_info.site_name|default=''}</title>
<include file="appapi@head"/>
<link href="__STATIC__/appapi/css/share.css?t=1642239978" rel="stylesheet">
</head>

<body class="body-white">
    <div class="share_top">
        <div class="share_logo">
            <img src="/logo.png">
        </div>
        <div class="share_name">{$site_info.site_name|default=''}</div>

        <div class="share_btn">
            <a href="javascript:void(0)" data-type="1">
                <img src="__STATIC__/appapi/images/share/ios.png?t=1642238208"> iPhone下载
            </a>
            <a href="javascript:void(0)" data-type="0">
                <img src="__STATIC__/appapi/images/share/android.png?t=1642238208"> Android下载
            </a>
        </div>
    </div>

    <div class="share_bottom">
        <if condition="$userinfo">
            <div class="share_user">
                <img src="{$userinfo['avatar']}">
                <div class="share_user_info">
                    <p class="share_user_info_name">{$userinfo['user_nickname']}</p>
                    <p class="share_user_info_des">邀请您来{$site_info.site_name|default=''}体验</p>
                </div>
            </div>
        </if>
        <if condition="$code neq ''">
            <div class="share_code">邀请码：{$code}</div>
        </if>
    </div>

    <include file="appapi@scripts"/>
    <script>

        const Down={
            btn:$(".share_btn a"),
            isok:0,
            init:function (){
                let _this=this;
                _this.isok=1;
                _this.btn.on('click',function (){
                    let _that=$(this);
                    let type=_that.data('type');

                    _this.down(type);
                })
            },
            down:function (type=0){
                if(type==1){
                    location.href='{$site_info.ipa_url}';
                }else{
                    location.href='{$site_info.apk_url}';
                }
            }
        }

        Down.init();


    </script>
</body>
</html>